package cn.tedu.collection;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Test11 {
    public static void main(String[] args) {
        Random r = new Random();
        char[] a1 = new char[5];
        for (int j = 0; j < a1.length; j++) {
            int a3;
            if (r.nextInt(2)==0) {
                a3 = 97 + r.nextInt(26);
            }else {
                a3 = 65 + r.nextInt(26);
            }
            a1[j] = (char) a3;
        }
       System.out.println(a1);

        String a ="HelloWord";

        System.out.println(a.length());
        System.out.println(a.indexOf("o"));
        System.out.println(a.lastIndexOf("o"));
        System.out.println(a.substring(0,5));
        System.out.println(a.substring(5));
        String a11 ="  Hello  ";
        System.out.println(a11.trim());

        String[] a12 =a.split("");
        for (int i = 0; i <a12.length ; i++) {
        }
        System.out.println(a12[5]);
        System.out.println(a.startsWith("h"));
        System.out.println(a.endsWith("ld"));
        System.out.println(a.toUpperCase());
        System.out.println(a.toLowerCase());
    }

}
